<?php

namespace app\admin\model;

use think\migration\command\seed\Run;
use think\Model;
use app\admin\model\User;

class Cloudphone extends Model
{

    // 表名
    protected $name = 'cloudphone';

    public function package(){
        return $this->belongsTo("package",'package_id','id');
    }

    const STATUS_INIT = 1;
    const STATUS_RESTORE  = 2;
    const STATUS_FAIL = -1;
    public function statusList(){
        return [
            ['id'=>self::STATUS_INIT,'name'=>'就绪'],
            ['id'=>self::STATUS_RESTORE,'name'=>'还原中'],
            ['id'=>self::STATUS_FAIL,'name'=>'还原失败'],
        ];
    }
    public function statusList2(){
        return [
            self::STATUS_INIT=>'待付款',
            self::STATUS_RESTORE=>'还原中',
            self::STATUS_FAIL=>'还原失败',
        ];
    }

    public function getStatusColor()
    {

        return [
            self::STATUS_INIT=>'bg-teal',
            self::STATUS_RESTORE=>'bg-green',
            self::STATUS_FAIL=>'bg-red',
        ];
    }
}
